﻿//CommissionRule.cs
//Copyright (c) 2013 StockSharp LLC, all rights reserved.
//This code module is part of StockSharp library.
//This code is licensed under the GNU GENERAL PUBLIC LICENSE Version 3.
//See the file License.txt for the license details.
//More info on: http://stocksharp.com

namespace StockSharp.Algo.Commissions
{
	using System.Runtime.Serialization;

	using StockSharp.BusinessEntities;

	/// <summary>
	/// Типы комиссий.
	/// </summary>
	[DataContract]
	public enum CommissionTypes
	{
		/// <summary>
		/// Комиссия за заявку.
		/// </summary>
		[EnumMember]
		PerOrder,

		/// <summary>
		/// Комиссия за объем в заявке.
		/// </summary>
		[EnumMember]
		PerOrderVolume,

		/// <summary>
		/// Комиссия за превышение количества заявок.
		/// </summary>
		[EnumMember]
		OrderCount,

		/// <summary>
		/// Комиссия за сделку.
		/// </summary>
		[EnumMember]
		PerTrade,

		/// <summary>
		/// Комиссия за цену сделки.
		/// </summary>
		[EnumMember]
		PerTradePrice,

		/// <summary>
		/// Комиссия за объем в сделке.
		/// </summary>
		[EnumMember]
		PerTradeVolume,

		/// <summary>
		/// Комиссия за количество сделок.
		/// </summary>
		[EnumMember]
		TradeCount,

		/// <summary>
		/// Комиссия инструмента.
		/// </summary>
		[EnumMember]
		Security,

		/// <summary>
		/// Комиссия типа инструмента.
		/// </summary>
		[EnumMember]
		SecurityType,

		/// <summary>
		/// Комиссия по обороту.
		/// </summary>
		[EnumMember]
		TurnOver,
	}

	/// <summary>
	/// Настройки комиссии.
	/// </summary>
	[DataContract]
	public class CommissionRule
	{
		/// <summary>
		/// Тип комиссии.
		/// </summary>
		[DataMember]
		public CommissionTypes Type { get; set; }

		/// <summary>
		/// Дополнительная информация по типу комиссии <see cref="Type"/>.
		/// </summary>
		[DataMember]
		public object TypeValue { get; set; }

		/// <summary>
		/// Значение комиссии.
		/// </summary>
		[DataMember]
		public Unit Value { get; set; }
	}
}